package HashMap;

import java.util.HashMap;
import java.util.Set;

public class HashMapDemo {
    public static void main(String[] args) {
        HashMap<String,Student> hm=new HashMap<String,Student>();
        Student s1=new Student("ABNER",50);
        Student s2=new Student("ABNER2",5000);
        Student s3=new Student("ABNER3",500);
        Student s4=new Student("ABNER4",50000);
        hm.put("hanser1",s1);
        hm.put("hanser2",s2);
        hm.put("hanser3",s3);
        hm.put("hanser4",s4);
        Set<String> keySet = hm.keySet();
        for(String key:keySet){
            Student value =hm.get(key);
            System.out.println(key+","+value.getName()+","+value.getAge());
        }
    }
}
